package com.bw.exam.result;

import lombok.Data;

/**
 * @author: liuzhiping
 * @date: 2024/8/15 11:28
 **/
@Data
public class R {
    private Integer code;
    private Integer status;
    private String msg;
    private Object data;

    public static R success(){
        R r = new R();
        r.setCode(200);
        r.setStatus(1);
        r.setMsg("success");
        return  r;

    }
    public static R success(Object data){
        R r = new R();
        r.setCode(200);
        r.setStatus(1);
        r.setMsg("success");
        r.setData(data);
        return  r;

    }


    public static R fail(){
        R r = new R();
        r.setCode(400);
        r.setStatus(0);
        r.setMsg("fail");
        return  r;

    }


    public static R fail(String msg){
        R r = new R();
        r.setCode(400);
        r.setStatus(0);
        r.setMsg(msg);
        return  r;

    }
}
